<template>
	<view class="setting">
		<view class=" box scale-1px-bottom"  @tap="getnav(router(`changePhone`))">
			<view class="next word">更换绑定手机号</view>
		</view>
		<view class=" box scale-1px-bottom" @tap="getnav(router(`aboutUs`))">
			<view class="next word">关于我们</view>
		</view>
		<view class=" box scale-1px-bottom" @tap="getnav(router(`useful`))">
			<view class="next word">使用帮助</view>
		</view>
		<view class=" box disFlex scale-1px-bottom">
			<view class="word">联系我们</view>
			<view class="phone" @tap="call">{{phone}}</view>
		</view>
		
		<view class="bottom" @tap="go">退出登录</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				phone:''
			}
		},
		onLoad() {
			this.query();
		},
		methods: {
			query () {
				this.http('/api/setting/read', 'post', {code:'service_phone'})
				.then((res)=>{
					this.phone=res.data.data					
				})
			},
			call () {
				uni.makePhoneCall({
					phoneNumber:this.phone
				})
			},
			go () {
				uni.showModal({
					title:'提示',
					content:'是否确定退出登录？',
					cancelColor:'#BEC9D7',
					confirmText:'确认',
					success: (e) => {
						if (e.confirm) {
								uni.removeStorageSync('userinfo');
								uni.reLaunch({
									url:this.router(`login`)
								})
						uni.showToast({ title: '退出成功!', icon: 'none' })
						}
					}
				})
			}
		}
	}
</script>

<style lang="less">
	.setting{
		padding: 0 32rpx;
		.box{
			padding: 32rpx 0;
			.word{
				font-size:32rpx;
				color:rgba(51,51,51,1);
			}
			.phone{
				font-size:32rpx;
				color:rgba(153,153,153,1);
			}
		}
		.bottom{
			// margin-top: 100rpx;
			position: fixed;
			left: 40rpx;
			bottom: 30rpx;
			width: calc(100% - 80rpx);
			background:rgba(245,245,249,1);
			border-radius:10rpx;
			color: #BEC9D7;
			letter-spacing: 2px;
			display: flex;
			align-items: center;
			height: 90rpx;
			justify-content: center;
			font-size: 36rpx;
		}
	}
</style>
